const express = require('express');
// 引入代理模块
const {createProxyMiddleware} = require('http-proxy-middleware')
const app = express();
app.use(express.static('www'));

app.use(createProxyMiddleware('/api',{  
    target:'http://192.168.21.249:3002',
    pathRewrite:{

        '^/api': '' 
    }, 
    changeOrigin:true
}))


app.get('/query',function(req,res){
    console.log('----');
    console.log(req.query);
    res.send('苏丽敏大美女');
})


app.listen('3000',function(){
    console.log('这是项目一,端口:3000');
    
})